<%-- 
    Document   : ListSach
    Created on : Jun 16, 2013, 1:14:56 PM
    Author     : quannq
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<c:if test="${not empty sach1}">${sach1}</c:if>
<c:if test="${not empty sach2}">${sach2}</c:if>
<c:if test="${not empty sach3}">${sach3}</c:if>
<c:if test="${not empty sachtg}">${sacgtg}</c:if>
<c:if test="${not empty sachnxb}">${sachnxb}</c:if>
    <table cellpadding="0" cellspacing="0" border="1" class="display example"
           style="color: black; width: 1000px;">
        <thead align="center">
            <tr>
                <th>ID</th>
                <th>Ảnh Bìa</th>
                <th>Tên Sách</th>
                <th>Tác Giả</th>
                <th>Thể Loại</th>
                <th>Cân Nặng</th>
                <th>Giá Bìa</th>
                <th>Năm</th>
                <th>Thao tác</th>
            </tr>
        </thead>
        <tbody align="center">
        <c:if test="${fn:length(theloai1.sachs) == 0}">
            <tr class="gradeX">
                <td>No data</td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
        </c:if>

        <c:if test="${fn:length(theloai1.sachs) > 0}">
            <c:forEach items="${theloai1.sachs}" var="sach">

                <tr class="gradeX">
                    <td>${sach.masach}</td>
                    <td><img width=60 height=80 src="${pageContext.request.contextPath}/image/sell/${sach.anhbia}" /></td>
                    <td><a href="javascript:modalFormUpdate('infosach',${sach.masach});">${sach.tensach}</a></td>
                    <td>${sach.tacgia.tentacgia}</td>
                    <td>${sach.theloai1.tentl1}</td>
                    <td>${sach.cannang}</td>
                    <td>${sach.giabia}</td>
                    <td>${sach.namxb}</td>
                    <td><img src="${pageContext.request.contextPath}/image/admin/print.png" /></td>

                </tr>

            </c:forEach>
        </c:if>
    </tbody>
</table>
<script type="text/javascript">
    $(document).ready(function() {
        $('.example').dataTable({
            "aaSorting": [[0, "desc"]],
            "fnRowCallback": function(nRow, aData, iDisplayIndex) {
                var index = 0;
                var subscriberId = aData[index];

                return nRow;
            },
            "aoColumnDefs": [{
                    "aTargets": [0]
                }],
            "sPaginationType": "full_numbers"
        });
    });
</script>

